const Router = require('koa-router')
const auth = require('@/middleware/auth')
const router = new Router({
  prefix: '/article', // 路由前缀
})

const { getArticleList, getArticleDetail, saveArticle,deleteArticle } = require('@/controller/article') // 引入控制器

router.post('/list', getArticleList) // 获取文章列表
router.get('/detail/:id', getArticleDetail) // 获取文章详情
router.post('/save', auth,saveArticle) // 保存文章
router.post('/delete',auth, deleteArticle) // 删除文章

module.exports = router
